#!/bin/sh -e
GIT_PROXY_FILE=$HOME/bin/git-proxy.sh
PROXY_IP=proxy.tencent.com
PROXY_PORT=8080
test -d $(dirname $GIT_PROXY_FILE) || mkdir -p $(dirname $GIT_PROXY_FILE)

sudo apt-get install corkscrew

echo "#!/bin/sh" > $GIT_PROXY_FILE
echo "exec /usr/bin/corkscrew $PROXY_IP $PROXY_PORT \$*" >> $GIT_PROXY_FILE
chmod +x $GIT_PROXY_FILE

git config --global core.gitproxy $GIT_PROXY_FILE
